package ModelImplementation

import "time"

type BiweeklySchedule struct {
}

func (bs BiweeklySchedule) GetPayPeriodStartDate(payPeriodEndDate time.Time) time.Time {
	return payPeriodEndDate.AddDate(0, 0, -13) //Saturday, two weeks ago.
}

func (bs BiweeklySchedule) IsPayData(payDate time.Time) bool {
	firstPaydayFriday := time.Date(2000, 12, 14, 0, 0, 0, 0, time.Local)

	ts := payDate.Sub(firstPaydayFriday)

	daySinceFirstPayableFriday := int(ts.Hours()) / 24
	two := (daySinceFirstPayableFriday%14 == 0) //two weeks
	return two
}
